<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML>
<html>
<head>
<base href="<%=basePath%>">
<title>流水账</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<%-- 引用layui.css --%>
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>js/layui/css/layui.css" />
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>css/common.css" />
</head>
<body>
	<div class="ibox">
		<div class="ibox-content bodycss">
			<!-- 表单搜索 开始 -->
			<section class="panel panel-padding ">
				<form class="layui-form layui-form-pane form-search"
					onsubmit="return false" method="post">
						<div class="layui-form-item layui-inline">
						<label class="layui-form-label">日期</label>
						<div class="layui-input-inline">
							<input type="text" name="startDate" id="startDate" value="" placeholder="请输入起始日期"
								class="layui-input">
						</div>
						<div class="layui-input-inline">
							<input type="text" name="endDate" id="endDate" value="" placeholder="请输入终止日期"
								class="layui-input">
						</div>
					<div class="layui-form-item layui-inline">
						<button class="layui-btn layui-btn-primary" lay-submit
							lay-filter="seach">
							<i class="layui-icon"></i> 搜索
						</button>
					</div>
				</form>
			</section>
			<!-- 表单搜索 结束 -->
			<section class="panel panel-padding ">
				<c:if test="${sessionScope.userpopedom.ddgl03xcel eq '1' }">
					<!-- pagecontext request session application -->
					<div class="ibox-toolbar">
						<button id="exportExcel" data-modal="" data-title="导出Excel"
							class="layui-btn layui-btn-sm">
							<i class="layui-icon">&#xe667;</i> 导出Excel
						</button>
					</div>
				</c:if>
				<table class="layui-table"
					lay-data="{
	                        id: 'menuTeble',
	                        width:'auto',
	                        url:'ServicePoint/queryRunaccount.do',
	                        method:'post',
	                        page:true,
	                        even:true,
	                        skin:'row',
	                        limits:[10,20,30,40,50],
	                        limit:10}"
					lay-filter="popedomLay">
					<!-- lay-filter:监听 -->
					<thead>
						<tr>
							<th
								lay-data="{checkbox:true,disabledKey:'check_status',disabledKeyValue:'1,2'}"></th>
							<th lay-data="{type:'numbers', width:50}">序号</th>
							<th lay-data="{field:'addData', width:200,align:'center'}">日期</th>
							<th lay-data="{field:'area_name', width:200,align:'center'}">服务点名称</th>
							<th lay-data="{field:'rech_amount', width:200,align:'center'}">收入金额</th>
							<th
								lay-data="{field:'order_sn', width:200,align:'center',templet:'#m_type'}">订单编号</th>
							<th
								lay-data="{field:'user_id', width:200,align:'center',templet:'#m_type'}">用户TVN号</th>
							<th
								lay-data="{field:'user_name', width:200,align:'center',templet:'#m_type'}">用户姓名</th>
						</tr>
					</thead>
				</table>
			</section>
		</div>
	</div>
	<script type="text/javascript" src="<%=basePath%>js/layui/layui.js"></script>
	<script type="text/javascript">
		layui.config({
			base : "<%=basePath%>/js/common/"
		}).use([ "common", "element", "layer", "form", "table", "jquery", "laydate"], function() {
			var elem = layui.element;
			var layer = layui.layer;
			var form = layui.form;
			var table = layui.table;
			var $ = layui.jquery;
			var laydate = layui.laydate;
			layui.common.init();
			 laydate.render({
			    elem: '#startDate' //指定元素
			  });
			 laydate.render({
			    elem: '#endDate' //指定元素
			  });
			/**
			 * 监听刷新表格
			 */
	
			/* 当点击搜索时，执行重载 */
			form.on('submit(seach)', function(data) {
				// layer.msg(JSON.stringify(data.field));
				table.reload('menuTeble', {
					where : data.field,
					page : {
						curr : 1
					}
				});
				return false;
			});
	
			//导出Excel
			$("#exportExcel").on("click", function() {
				layer.load(2, {
					time : 1000
				});
				window.location.href = "ServicePoint/export.do?startDate=" + $("#startDate").val() +"&endDate="+$("#endDate").val();
			});
		});
	</script>
</body>
</html>
